<?php
/**
 * DolphinGTK - phpGtk framework
 *
 * Графический модуль
 *
 * @package    DolphinGTK
 * @author     Askarov Ruslan
 * @copyright  Askarov Ruslan (c) 2010.
 * @link       http://groups.google.com/group/dolphingtk
 * @license    http://www.opensource.org/licenses/gpl-license.php GPL
 * @version    0.1
 * @since      PHP v.: 5.2.1
 * @subpackage desktop
 * @category   module
 * @filesource
 */


class Table_ex
{
  private static $table;
  private static $progress;

  public function set()
  {
    self::$table = new Table;
    self::$table->row_color('#dddddd', '#ffffff');
    self::$table->sortable(true);
    self::$table->editable(true, array('Table_ex', 'editable'), array(2));

    $list = array('ubuntu', 'gentoo', 'debian');

    self::$table->create(
      array('checkbox', '#' ),
      array('icon',     i18n('Icon') ),
      array('string',   i18n('String') ),
      array('radio',    i18n('Radio') ),
      array('select',   i18n('Select'), $list),
      array('progress', i18n('Progress'))
    );

    self::$table->insert(array(
        true,
        'home',
        'row #1',
        false,
        'ubuntu',
        0
      )
    );

    self::$table->insert(array(
        false,
        'print',
        'row #2',
        true,
        'gentoo',
        23
      )
    );

    self::$table->insert(array(
        true,
        'harddisk',
        'row #3',
        false,
        'debian',
        65
      )
    );

    Win::timeout('add',array('Table_ex','progress'), 1000);

    return self::$table->get();
  }


  public function progress()
  {
    if( self::$progress < 100 ) {
      self::$progress ++;
      self::$table->update(0,5,self::$progress);
      Win::timeout('add',array('Table_ex','progress'), 50);
    } else {
      self::$table->delete(0);
      self::$table->update(0,2,'row #1 (rename from row #2)');
      self::$table->update(1,2,'row #2 (rename from row #3)');
    }
  }


  public function editable() {}
}
?>
